package com.pactera.asmp.server.dao;

import com.pactera.asmp.server.entity.ProjectInfoSearchDTO;
import com.pactera.asmp.server.pojo.ProjectInfo;
import com.pactera.asmp.server.pojo.ProjectVersionInfo;
import com.pactera.asmp.server.pojo.ScreenDeviceInfo;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

/**
 * @ProjectName: asmpserver
 * @Package: com.pactera.asmp.server.dao
 * @ClassName: ProjectMapper
 * @Author: lvzhiqiang
 * @Description: 项目管理Mapper
 * @Date: 2019/8/9 15:38
 * @Version: 1.0
 */
@Mapper
public interface ProjectMapper {


    int deleteByPrimaryKey(Integer id);

    int insert(ProjectInfo record);

    int insertSelective(ProjectInfo record);

    ProjectInfo selectByPrimaryKey(Integer id);
    ProjectInfo selectByName(String name);
    ProjectInfo selectByIdAndName(Integer id,String name);

    int updateByPrimaryKeySelective(ProjectInfo record);


    /**
     * @Method getProjects
     * @Description getProjects
     * @param: projectInfoSearch
     * @return:  List<ProjectInfoSearchDTO>
     * @auther: lzq
     * @date: 2019/8/9 17:40
     */
    List<ProjectInfoSearchDTO> getProjects(@Param("projectInfoSearch") ProjectInfoSearchDTO projectInfo);

    /**
     * @Method getProjectInfoByUserId
     * @Description getProjectInfoByUserId
     * @param: id
     * @return: id
     * @auther: lzq
     * @date: 2019/8/9 17:39
     */
    List<ProjectInfo> getProjectInfoByUserId(Integer id);

    int deleteByPrimaryKeys(@Param("datas") List<Integer> datas);

    List<ProjectInfo> getProjectName(@Param("projectIds") List<Integer> projectIds);

    List<ProjectVersionInfo> getRecentVersion(@Param("projectName") String projectName);

    List<ProjectVersionInfo> getAllVersion(@Param("projectName") String projectName);

    ProjectInfo getRecentProjectNameByUserEmail(@Param("email") String email);

    List<ScreenDeviceInfo> getScreenDeviceListByProjectId(@Param("projectId") Integer projectId);
    List<ScreenDeviceInfo> getScreenMasterListByProjectId(@Param("projectId") Integer projectId);
    List<ScreenDeviceInfo> getScreenTaskingDeviceListByProjectId(@Param("projectId") Integer projectId);

    List<ProjectInfo> queryByPrimaryKeys(List<Integer> list);

    int updateByStatus(@Param("projectInfo")ProjectInfo projectInfo, @Param("dbProjectStatus")Integer dbProjectStatus);

    List<ProjectInfo> getProjectUnbindByDeviceId(@Param("deviceId") Integer deviceId);

    List<ProjectInfo> selectByNames(@Param("datas") List<String> datas);

    ProjectInfo selectByProjectId(@Param("projectId") Integer projectId, @Param("projectName") String projectName);

}
